<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <title>点击计数器</title>
</head>

<body>
    <button id="myButton">点击我</button>
    <p id="count">0</p >
    <script>
        const button = document.getElementById('myButton');
        const countElement = document.getElementById('count');
        let count = 0;
        button.addEventListener('click', function () {
            count++;
            countElement.textContent = count;
        });
    </script>
</body>

</html>